package ArryProTest;

import java.util.Arrays;

//二维数组的练习
//使用Object[][]存储整个表格的数据
public class Test04 {
    public static void main(String[] args) {
        //每一个一维数组代表一行数组
        Object[] emp0 = {1000,"许涛涛",12,"程序猿","2019-09-09"};
        Object[] emp1 = {1001,"许大涛",13,"程序猿","2019-09-09"};
        Object[] emp2 = {1002,"许二涛",16,"程序猿","2019-09-09"};


        Object[][] emps = new Object[3][];
        emps[0] = emp0;
        emps[1] = emp2;
        emps[2] = emp1;

        //打印二位数组的内容(表格数据打印)
        for (int i = 0; i < emps.length; i++) {
            System.out.println(Arrays.toString(emps[i]));
        }
        //使用嵌套循环打印二维数组（打印表格数据）
        for (int i = 0; i <emps.length ; i++) {
            for (int j = 0; j <emps[i].length; j++) {
                System.out.println(emps[i][j]+"\t");
            }
            System.out.println();
        }


    }
}
